import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "首页",
    component: HomeView,
  },
  {
    path: "/about",
    name: "关于我们",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/AboutView.vue"),
  },
  {
    path: "/sort",
    name: "归档",
    component: () =>
      import(/* webpackChunkName: "sort" */ "../views/SortView.vue"),
  },
  {
    path: "/classfly",
    name: "分类",
    component: () =>
      import(/* webpackChunkName: "classfly" */ "../views/ClassflyView.vue"),
  },
  {
    path: "/tag",
    name: "标签",
    component: () =>
      import(/* webpackChunkName: "tag" */ "../views/TagView.vue"),
  },
  {
    path: "/subject",
    name: "专题",
    component: () =>
      import(/* webpackChunkName: "subject" */ "../views/SubjectView.vue"),
  },
  {
    path: "/messageboard",
    name: "留言板",
    component: () =>
      import(
        /* webpackChunkName: "messageboard" */ "../views/MessageboardView.vue"
      ),
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
